/**
 * 文件名：****.java
 * 版权：Copyright Lightkit All Rights Reserved.
 * 描述：*****
 */
package com.lightkits.wms.controller;

import com.lightkits.wms.domain.willsemionhand.GetWmsOnhandService;
import com.lightkits.wms.dto.willsemionhand.GetWmsOnhandRequestType;
import com.lightkits.wms.dto.willsemionhand.GetWmsOnhandResponseType;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 魏静
 * @create 2019-07-24 19:25
 * @desc wms现有量传输控制层
 **/
@RestController
@RequestMapping("/WillSemiOnhandService")
public class WillSemiOnhandController {
    private final GetWmsOnhandService onhandService;

    @Autowired
    public WillSemiOnhandController(GetWmsOnhandService onhandService) {
        this.onhandService = onhandService;
    }

    @PostMapping(value = "/getWmsOnhand")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getWmsOnhand")
    @ResponseBody
    public GetWmsOnhandResponseType getWmsOnhand(@RequestBody(required = false) GetWmsOnhandRequestType request) {
        GetWmsOnhandResponseType response = new GetWmsOnhandResponseType();
        response.setSuccessful(true);
        response.setWmsOnhandDtos(onhandService.getOnhand());
        return response;
    }
}
